import Store from '@/modules/Store'


export default function(resource,params){
    var location = resource+'?export=1&token='+Store.state.user.token;
    var query = {
        ...params
    };
    for(var k in query){
        location += '&'+k+'='+query[k];
    }
    var iframe = document.createElement('iframe');
    iframe.style.display = 'none';
    iframe.src = location;
    iframe.onload = function () {
      document.body.removeChild(iframe);
    }
    document.body.appendChild(iframe);
}
